package com.fjnldx.mes.domain.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * 轮班设置
 */
@Data
@TableName(value = "scheduling_shift")
@NoArgsConstructor
public class SchedulingShift {
  @TableId(type = IdType.AUTO)
  private Integer id;
  private String org;
  private String cj;
  private String gongxu;
  private String shiftType;
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private LocalDateTime startTime;
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private LocalDateTime endTime;
  private String bcInit;
  private String bh;
  private String bc;

  public SchedulingShift(SchedulingShift params) {
    this.id=null;
    this.org = params.getOrg();
    this.cj = params.getCj();
    this.gongxu = params.getGongxu();
    this.shiftType = params.getShiftType();
    this.startTime = params.getStartTime();
    this.endTime = params.getEndTime();
    this.bcInit = params.getBcInit();
    this.bh =params.getBh();
    this.bc = params.getBc();
  }
}
